package com.dingwei.superiordiary.ui.activity;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.allen.library.SuperButton;
import com.dingwei.superiordiary.R;
import com.dingwei.superiordiary.adapter.easyViewHolder.FindingsAuditHolder;
import com.dingwei.superiordiary.adapter.easyViewHolder.WaitAuditHolder;
import com.dingwei.superiordiary.mvp.presenter.FindingsAuditPresenter;
import com.dingwei.superiordiary.mvp.view.Contract;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter;
import com.lihao.baselibrary.base.BaseActivity;
import com.lihao.baselibrary.weight.TitleBar;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created time 2018/1/17.
 * Creator 南柯一梦丶 on
 * Personal signature 余生还长 何必慌张
 * Page description :
 */

public class FindingsAuditActivity extends BaseActivity implements Contract.FindingsAuditView {
    FindingsAuditPresenter findingsAuditPresenter = new FindingsAuditPresenter(this);
    @Bind(R.id.main_titleBar)
    TitleBar mainTitleBar;
    @Bind(R.id.m_recyclerView)
    RecyclerView mRecyclerView;
    @Bind(R.id.btn_submit)
    SuperButton btnSubmit;
    @Bind(R.id.data_layout)
    LinearLayout dataLayout;
    @Bind(R.id.no_net_btn)
    TextView noNetBtn;
    @Bind(R.id.no_net_layout)
    RelativeLayout noNetLayout;

    @Override
    protected int getContentViewId() {
        return R.layout.activity_findings_audit;
    }

    RecyclerArrayAdapter mAdapter = new RecyclerArrayAdapter(BaseActivity.context) {
        @Override
        public BaseViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) {
            return new FindingsAuditHolder(parent);
        }
    };
    @Override
    protected void initData() {
        mAdapter.add("");
        mAdapter.add("");
        mAdapter.add("");
        mAdapter.add("");
        mAdapter.add("");
    }

    @Override
    protected void initView() {
        LinearLayoutManager layoutManager = new LinearLayoutManager(context);
        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        mRecyclerView.setLayoutManager(layoutManager);
        mRecyclerView.setNestedScrollingEnabled(false);

        mRecyclerView.setAdapter(mAdapter);
    }

    @Override
    protected void initListener() {
        mainTitleBar.setOnMenuListener(new TitleBar.OnMenuListener() {
            @Override
            public void onMenuClick() {

            }
        });
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    @OnClick({R.id.btn_submit, R.id.no_net_btn})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.btn_submit:
                break;
            case R.id.no_net_btn:
                break;
        }
    }
}
